PUT contour
curl --request PUT \
--url https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-SIMA-SYSTEM-ID: <api-key>' \
--data '
{
"fractions": [
{
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
}
}
],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0"
}
}
'import requests
url = "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour"
payload = {
"fractions": [
{
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [[[-64, -31], [-63.99, -31], [-63.99, -30.99], [-64, -30.99], [-64, -31]]]
}
}
],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0"
}
}
headers = {
"Authorization": "Bearer <token>",
"X-SIMA-SYSTEM-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-SIMA-SYSTEM-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fractions: [
{
key: 'postman-1',
name: 'Fracción 1',
geometry: {
type: 'Polygon',
coordinates: [[[-64, -31], [-63.99, -31], [-63.99, -30.99], [-64, -30.99], [-64, -31]]]
}
}
],
reference_point: {lat: '-31.0', lon: '-64.0'}
})
};
fetch('https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fractions' => [
[
'key' => 'postman-1',
'name' => 'Fracción 1',
'geometry' => [
'type' => 'Polygon',
'coordinates' => [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
]
]
],
'reference_point' => [
'lat' => '-31.0',
'lon' => '-64.0'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-SIMA-SYSTEM-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fractions": [
{
"id": 1001,
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
},
"area_ha": 12.45,
"holes_count": 0,
"invalid": false,
"invalid_reason": null
}
],
"area_ha": 12.45,
"area_in_plots_ha": 0,
"area_unassigned_ha": 12.45,
"has_plots": false,
"plots": [],
"overlaps": [],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0",
"outside": false
},
"suggested_reference_point": null
}{
"key": "bad-1",
"title": "An error occurred",
"detail": "establishment_contour.fraction_invalid",
"status": 422
}Version 3 > Establishment Contours
PUT contour
Guarda el contorno del establecimiento. Requiere EDIT. Una fracción inválida responde 422 e identifica key.
PUT
/
api
/
v3
/
third_party
/
establishments
/
{new_establishment}
/
contour
PUT contour
curl --request PUT \
--url https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-SIMA-SYSTEM-ID: <api-key>' \
--data '
{
"fractions": [
{
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
}
}
],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0"
}
}
'import requests
url = "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour"
payload = {
"fractions": [
{
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [[[-64, -31], [-63.99, -31], [-63.99, -30.99], [-64, -30.99], [-64, -31]]]
}
}
],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0"
}
}
headers = {
"Authorization": "Bearer <token>",
"X-SIMA-SYSTEM-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-SIMA-SYSTEM-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fractions: [
{
key: 'postman-1',
name: 'Fracción 1',
geometry: {
type: 'Polygon',
coordinates: [[[-64, -31], [-63.99, -31], [-63.99, -30.99], [-64, -30.99], [-64, -31]]]
}
}
],
reference_point: {lat: '-31.0', lon: '-64.0'}
})
};
fetch('https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fractions' => [
[
'key' => 'postman-1',
'name' => 'Fracción 1',
'geometry' => [
'type' => 'Polygon',
'coordinates' => [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
]
]
],
'reference_point' => [
'lat' => '-31.0',
'lon' => '-64.0'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-SIMA-SYSTEM-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fractions": [
{
"id": 1001,
"key": "postman-1",
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
},
"area_ha": 12.45,
"holes_count": 0,
"invalid": false,
"invalid_reason": null
}
],
"area_ha": 12.45,
"area_in_plots_ha": 0,
"area_unassigned_ha": 12.45,
"has_plots": false,
"plots": [],
"overlaps": [],
"reference_point": {
"lat": "-31.0",
"lon": "-64.0",
"outside": false
},
"suggested_reference_point": null
}{
"key": "bad-1",
"title": "An error occurred",
"detail": "establishment_contour.fraction_invalid",
"status": 422
}Authorizations
access_token obtenido via POST /api/v2/login
Identificador del sistema integrador (8 para Third-Party API)
Path Parameters
Body
application/json
The body is of type object.
Response
OK
The response is of type object.

